
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections;



namespace Swaf.BizRule
{
	/// <summary>
	/// Summary description for IRuleExecutor.
	/// </summary>
	public interface IRuleExecutor : ISimpleRuleExecutor
	{
		/// <summary> Execute a single business rule with a callback object/method that will be 
		/// called with the results of the rule call when the rule has completed.</summary>
		/// <remarks>
		/// <p>
		/// This is an asynchronous version of the <code>execute</code> method, allowing the
		/// client caller to do other things while the rule is executing.
		/// </p><p>
		/// It is possible to pass in <code>null</code> for the callback object and method
		/// and to use the IRuleGroup object returned to poll for the completion of the
		/// rule.</p></remarks>
		/// <param name="ruleName">
		/// </param>
		/// <param name="callback">
		/// </param>
		/// <param name="callbackMethod">
		/// </param>
		/// <param name="callParams">
		/// </param>
		/// <returns>
		/// 
		/// </returns>
		IRuleGroup execute(string ruleName, object callback, string callbackMethod, object callParams);
		IRuleGroup execute(IRuleContext context, string ruleName, object callback, string callbackMethod, object callParams);

		IRuleGroup execute(string ruleCallInfo, object callback, string callbackMethod);
		
		/// <summary>Executes multiple business rules with a callback object/method that will be 
		/// called with the resultswhen all the rules specified have completed.</summary>
		/// <remarks>
		/// <p>This is an asynchronous version of the <code>execute</code> method, allowing the
		/// client caller to do other things while the multiple rules are executing.
		/// </p><p>
		/// It is possible to pass in <code>null</code> for the callback object and method
		/// and to use the IRuleGroup object returned to poll for the completion of the
		/// rules.</p></remarks>
		/// <param name="ruleName">
		/// </param>
		/// <param name="callParams">
		/// </param>
		/// <param name="callback">
		/// </param>
		/// <param name="callbackMethod">
		/// </param>
		/// <returns>
		/// IRuleGroup array, one for each rule being called.
		/// </returns>
		IRuleGroup[] execute(string[] ruleName, object[] callParams, object callback, string callbackMethod);

	}
}
